package com.javaee.ch11.web.dto;

import com.javaee.ch11.common.base.BaseEntity;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class DepartmentDto extends BaseEntity {

    // 部门编号，必须非空
    @NotNull(message = "部门编号不能为空")
    private Long id;

    // 部门名称，必须非空
    @NotBlank(message = "部门名称不能为空")
    @Size(min = 2, max = 50, message = "部门名称长度必须在2到50之间")
    private String name;

    // 部门负责人，必须非空
    @NotBlank(message = "部门负责人不能为空")
    @Size(min = 2, max = 50, message = "部门负责人长度必须在2到50之间")
    private String manager;
}    